#ifndef WINDOWFILE_INCLUDE
#define WINDOWFILE_INCLUDE

#include <stdio.h>
#include "md5.h"
typedef unsigned char byte_t;
struct WindowFile
{
	FILE* fp;

	unsigned long window_index;
	byte_t* window;
	size_t window_size;
	unsigned long window_end;

	size_t offset;

	unsigned long buf_index;
	byte_t* buf;
	size_t buf_size;
	unsigned long buf_end;
};

bool initWindowFile(WindowFile &windowFile, FILE* fp, size_t window_size, size_t buf_size);

void freeWindowFile(WindowFile &windowFile);

bool moveWindow(WindowFile &windowFile, byte_t* date_p);

md5_byte_t* getWindowMD5(WindowFile &windowFile, md5_byte_t* digest);

#endif /* WINDOWFILE_INCLUDE */